<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>我的订单</title>
        <meta content="telephone=no,email=no,address=no" name="format-detection" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="msapplication-tap-highlight" content="no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta name="wap-font-scale" content="no" />
        <link rel="stylesheet" type="text/css" href="__CSS__color.css?version={:config('version')}" />
        <link rel="stylesheet" type="text/css" href="__CSS__pay/common.css?version={:config('version')}" />
        <link rel="stylesheet" type="text/css" href="__CSS__pay/order.css?version={:config('version')}" />

        <script type="text/javascript" src="__JS__jquery.js?v={:config('version')}"></script>
        <script type="text/javascript" src="__JS__common.js?v={:config('version')}"></script>
        <script type="text/javascript" src="__JS__swiper.min.js?v={:config('version')}"></script>
        <script type="text/javascript" src="__JS__layer/layer.js?v={:config('version')}"></script>
        <script type="text/javascript" src="__JS__laydate/laydate.js?v={:config('version')}"></script>
        <style type="text/css">
            .error img{
                width:5rem;
                height:5rem;
                margin:8rem 0 2rem;
            }
        </style>
    </head>
    <body>
        <div class="order wrap pbwrap">
            <div class="order-list">
                {if condition="$data != ''"}
                    {volist name="data" id="vo"}
                        <dl class="radius10 white-bg">
                            <dd class="color3">订单号：{$vo.order_num}</dd>
                            <dd>{$vo.partner_name}</dd>
                            <dd>{$vo.product_name}
                                <span class="orange-color">
                                    {if condition="$vo.order_type == 1"}
                                    （工蚂付{if condition="$vo.insuranceInfo == 1"}+保险{/if}）
                                    {elseif condition="$vo.order_type == 3"}
                                    （首付）
                                    {elseif condition="$vo.order_type == 6"}
                                    （保险）
                                    {/if}
                                </span>
                            </dd>
                            <dd>金额：¥{$vo.amount}</dd>
                            <dd>下单时间：{$vo.add_time}</dd>
                            <dd class="order-btn-box">
                                {switch name="$vo.status" }
                                    {case value="1000"}
                                        <!--保单去掉取消订单-->
                                        {if condition="$vo.order_type != 6"}
                                            <a href="javascript:void(0);" onclick="cancelOrder('{$vo.order_num}')">取消订单</a>
                                        {/if}
                                        <a href="{$vo.pay_link}/?type=4&order_num={$vo.order_num}" class="orange-boder orange-color">待付款</a>
                                    {/case}
                                    {case value="2000"}
                                        <a href="succPayDetail?order_num={$vo.order_num}" class="orange-boder orange-color">付款成功</a>
                                    {/case}
                                    {case value="3000"}
                                        {if condition="$vo.order_type != 6"}
                                            <a href="javascript:void(0);" onclick="cancelOrder('{$vo.order_num}')">取消订单</a>
                                        {/if}
                                        <a href="{$vo.pay_link}/?order_num={$vo.order_num}" class="orange-boder orange-color">待付款</a>
                                    {/case}
                                    {case value="4000"}
                                        <a href="succPayDetail?order_num={$vo.order_num}" class="orange-boder orange-color">支付失败</a>
                                    {/case}
                                    {case value="5000"}
                                        <!-- href="pay?order_num={$vo.order_num}" -->
                                        <a href="javascript:;">已取消</a>
                                    {/case}
                                    {default /}
                                        {if condition="$vo.order_type != 6"}
                                            <a href="javascript:void(0);" onclick="cancelOrder('{$vo.order_num}')">取消订单</a>
                                        {/if}
                                        <a href="{$vo.pay_link}/?order_num={$vo.order_num}" class="orange-boder orange-color">待付款</a>
                                {/switch}
                            </dd>
                        </dl>
                    {/volist}
                {else /}
                    <div class="error wrap text-center">
                        <img class="apply" src="/static/images/apply.png" alt="">
                        <p class="color9">暂无订单</p>
                    </div>

                {/if}
            </div>
        </div>
        {include file="new_footer" /}
    </body>
</html>
<script>

//点击提交弹出遮罩层
function cancelOrder(order_num) {
    layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        skin: 'yourclass',
        btn:['确认取消','暂不取消'],
        success:function(layero){
            layero.find('.layui-layer-btn').css('text-align', 'center');
        },
        shadeClose: false,
        area: ['82%', ''],
        content: '确认取消后，该订单将被变更为取消状态，您是否确认取消？',
        btn1: function(index, layero){
            var datas = {
                interface:'IcbcPay@cancelOrder',
            };
            if(order_num){
                datas.order_num = order_num;
            }
            common.ajax({
                data: datas,
                success: function (data) {
                    if (data.status == '2000') {
                        falert(data.msg,'/orderPay');
                    } else if (data.status == '5001') {
                        falert(data.msg,'/pay/paylogin');
                    } else if (data.status == '5000') {
                        falert(data.msg);
                    }
                }
            });
        }
    });
}
</script>